package com.ruoyi.train.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.train.mapper.TrainTypeMapper;
import com.ruoyi.train.domain.TrainType;
import com.ruoyi.train.service.ITrainTypeService;

/**
 * 用印类型Service业务层处理
 *
 * @author ruoyi
 * @date 2022-09-01
 */
@Service
public class TrainTypeServiceImpl implements ITrainTypeService
{
    @Autowired
    private TrainTypeMapper trainTypeMapper;

    /**
     * 查询用印类型
     *
     * @param trainTypeId 用印类型主键
     * @return 用印类型
     */
    @Override
    public TrainType selectTrainTypeByTrainTypeId(Long trainTypeId)
    {
        return trainTypeMapper.selectTrainTypeByTrainTypeId(trainTypeId);
    }

    /**
     * 查询用印类型列表
     *
     * @param trainType 用印类型
     * @return 用印类型
     */
    @Override
    public List<TrainType> selectTrainTypeList(TrainType trainType)
    {
        return trainTypeMapper.selectTrainTypeList(trainType);
    }

    /**
     * 新增用印类型
     *
     * @param trainType 用印类型
     * @return 结果
     */
    @Override
    public int insertTrainType(TrainType trainType)
    {
        return trainTypeMapper.insertTrainType(trainType);
    }

    /**
     * 修改用印类型
     *
     * @param trainType 用印类型
     * @return 结果
     */
    @Override
    public int updateTrainType(TrainType trainType)
    {
        return trainTypeMapper.updateTrainType(trainType);
    }

    /**
     * 批量删除用印类型
     *
     * @param trainTypeIds 需要删除的用印类型主键
     * @return 结果
     */
    @Override
    public int deleteTrainTypeByTrainTypeIds(Long[] trainTypeIds)
    {
        return trainTypeMapper.deleteTrainTypeByTrainTypeIds(trainTypeIds);
    }

    /**
     * 删除用印类型信息
     *
     * @param trainTypeId 用印类型主键
     * @return 结果
     */
    @Override
    public int deleteTrainTypeByTrainTypeId(Long trainTypeId)
    {
        return trainTypeMapper.deleteTrainTypeByTrainTypeId(trainTypeId);
    }

    /**
     * 培训最低时间查询
     * @return
     */
    @Override
    public String selectMinTrainTime() {
        return trainTypeMapper.selectMinTrainTime();
    }

    /**
     * 培训最低时间设置
     * @param minTime
     * @return
     */
    @Override
    public int setMinTrainTime(String minTime) {
        return trainTypeMapper.setMinTrainTime(minTime);
    }
}
